<template>
  <DetailDescTable ref="DetailDescTable"  :title="$tt('label_warehouse_detail')" :descOption="detailDesc"
                   :url="detailUrl" :urlDataHandle="detailUrlDataHandle" />
</template>

<script>
import DetailDescTable from '../detail_common.vue'
export default {
  name: "detail_warehouse",
  components: { DetailDescTable },
  data() {
    return {
      detailUrl: '/oms-api/client/OmsBaseWarehouseClientRpc/detail.json',
      detailUrlDataHandle: (res) => {
        let { wavePlanDetailDTOList, ...descData } = res.data
        return {
          descData, tableData: wavePlanDetailDTOList,
        }
      },
      detailDesc: {
        model: [
          { key: 'code', label: 'label_warehouse_code' },
          { key: 'name', label: 'label_warehouse_name', },
          { key: 'type', label: 'label_warehouse_type', formatter: (r,c,v) => this.$enumShow(v, "WarehouseTypeEnum") },
          { key: 'status', label: 'label_status', formatter: (r,c,v) => this.$enumShow(v, "IsAvailableStatusEnum") },
          { key: 'manageType', label: 'label_operation_type', formatter: (r,c,v) => this.$enumShow(v, "WarehouseManageTypeEnum") },
          { key: 'position', label: 'label_warehouse_place',formatter: (r,c,v) => this.$enumShow(v, "BaseWarehousePositionEnum") },
          { key: 'countryName', label: 'label_country' },
          { key: 'province', label: 'label_province', },
          { key: 'city', label: 'label_city' },
          { key: 'county', label: 'label_region', },
          { key: 'address', label: 'label_detail_address', },
          { key: 'contacter', label: 'label_contact', },
          { key: 'phone', label: 'label_contact_phone', },
          { key: 'postcode', label: 'label_zip_code', },
          { key: 'totalArea', label: 'label_whole_warehouse_proportion',formatter: (r, c, v, i) => `${v}m³` },
          { key: 'usableArea', label: 'label_usable_warehouse_proportion', formatter: (r, c, v, i) => `${v}m³`},
          { key: 'longitude', label: 'label_lon', },
          { key: 'latitude', label: 'label_lat', },
          { key: 'creator', label: 'label_create_user', },
          { key: 'gmtCreate', label: 'label_create_time', formatter: (r, c, v, i) => this.$dateFormat(v) },
        ],
      },
    }
  },
  methods: {
    show({ title, ...obj }) {
      this.$refs['DetailDescTable'].show(obj)

    },

    hide() {
      this.$refs['DetailDescTable'].hide()
    },

  }
}
</script>

<style scoped>

</style>
